#ifndef TC_H
#define TC_H
#include "Subject.h"


// pointer based implementation

class TC : public Subject { 
public: 
	void	ChangeCost(double newM, double newS) {
		mobileCost = newM;
		statCost = newS;
		Notify(1);  // notify all
	}

	void	mobileUpgrade() {
		upgrade = true;
		Notify(0);  // notify mobile only
		upgrade = false;
		
	}

	double getMobileCost() { return mobileCost; }
	double getStatCost() { return statCost; }
	bool getUpgradeState() { return upgrade; }
	
	static void Destroy()	{ delete pTC; pTC = 0; } 
	static TC* createObj() { 
		if (pTC == 0)	{ pTC = new TC; } 
			return pTC; 
	} 
protected: 
	virtual ~TC()	{ } 
private: 
	static TC* pTC; 
private: 
	TC() {
		mobileCost = 0.0;
		statCost = 0.0;
		upgrade = false;
	} 
	TC(const TC&);	            // no copy 
	void operator=(TC&);		// no copy 

	double mobileCost;
	double statCost;
	bool upgrade;     
}; 

#endif
